<?php echo $this->render($this->includeDir . '/toolbar.php');?>
<?php echo $this->flashMessage();?>
<?php 
	$arrParam = $this->arrParam;
	$optionStatus = array(
						'pending' => 'Chờ xử lý',
						'appove' => 'Chấp nhận lịch hẹn',
						'deny' => 'Không chấp nhận lịch hẹn'
						);
	$full_name		= $this->formLabel('full_name',Zendvn_Filter_Filter::filterContent($this->Item['full_name']));
	$phone			= $this->formLabel('phone',Zendvn_Filter_Filter::filterContent($this->Item['phone']));
	$email			= $this->formLabel('email',Zendvn_Filter_Filter::filterContent($this->Item['email']));
	$date_appointment = $this->formLabel('date_appointment', date('d/m/Y H:i', strtotime($this->Item['date_appointment'])));
	$content 		= $this->formLabel('content',Zendvn_Filter_Filter::filterContent($this->Item['content']));
	$created 		= $this->formLabel('created', date('d/m/Y H:i:s', strtotime($this->Item['created'])));
	
	$doctor_comment = $this->formTextarea('doctor_comment', Zendvn_Filter_Filter::filterContent($this->Item['doctor_comment']),array('class'=>'width-400','rows'=>8));

	$status			= $this->formSelect('status', $this->Item['status'], null, $optionStatus);
	
	 if(count($this->errors)>0){	
	 	foreach ($this->errors as $key => $val){	 		
	 		$$key .= $this->cmsError($key,$val);	
	 		$selector = '.form-table #' . $key . '-error';
	 		$options = array('type'=>'error','name'=>'#' .$key);
	 		$formHelp  .= $this->cmsFormHelp($selector, $this->translate($val),null,$options);
	 		
	 	}
	 }
	 $arrRow = array(
					array('label'=>$this->translate('Họ và tên'),'input'=>$full_name),	
					array('label'=>$this->translate('Điện thoại'),'input'=>$phone),						
					array('label'=>$this->translate('Địa chỉ Email'),'input'=>$email),						
					array('label'=>$this->translate('Ngày khám bệnh'),'input'=>$date_appointment),
					array('label'=>$this->translate('Ngày gửi yêu cầu'),'input'=>$created),
					array('label'=>$this->translate('Nội Dung'),'input'=>$content),
					array('label'=>$this->translate('Bác sỹ trả lời'),'input'=>$doctor_comment),
					array('label'=>$this->translate('Trạng Thái'),'input'=>$status),
					);
	$tdForm = $this->partialLoop('row.php',$arrRow);
	
?>
<script type="text/javascript">
	$(document).ready(function() {
		<?php echo $formHelp;?>
	});
</script>
<div id="element-box">
	<div class="m">
		<div class="form-table">
        	<fieldset class="admin-fieldset">
                <legend class="admin-legend"><?php echo $this->translate('Form detail')?></legend>
            	<table width="100%" border="0">
                	<?php echo $tdForm;?>
                </table>
                <div class="clr"></div>
        	</fieldset>  
        </div>
       
        <div class="clr"></div>
	</div>
</div>
